package RevolCraft.Handlers;

import org.lwjgl.opengl.GL11;

import RevolCraft.Models.ModelDefaultBlock;

import net.minecraft.src.Block;
import net.minecraft.src.IBlockAccess;
import net.minecraft.src.RenderBlocks;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;

public class RenderHandler implements ISimpleBlockRenderingHandler {
	
	private static ModelDefaultBlock model;
	
	static
	{
		model = new ModelDefaultBlock();
	}

	@Override
	public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer)
	{
		//this.bindTextureByName(block.getTextureFile());
		GL11.glPushMatrix();
		GL11.glTranslatef(0, 1.f, 0);
		GL11.glRotatef(0, 0.F, 1.F, 0.F);
		GL11.glScalef(1.0F, -1.0F, -1.0F);
		model.renderAll();
		GL11.glPopMatrix();
	}

	@Override
	public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer)
	{
		return false;
	}

	@Override
	public boolean shouldRender3DInInventory()
	{
		return true;
	}

	@Override
	public int getRenderId() {
		return -1;
	}

}
